const url = {
  config: "/wechat/config",
  agentConfig: "/wechat/config/agent",
  redirect: '/wechat/redirect',
  authorize: '/wechat/authorize',
  sendMessage:'/wechat/send'
};
import { getAction, postAction } from "@/api/api";

export function getConfig() {
  return getAction(url.config, { url: location.href.split("#")[0] })
}

export function getAgentConfig() {
  return getAction(url.agentConfig, { url: location.href.split("#")[0] })
}

//获取重定向地址
export function getRedirectUrl(parameters) {
  return getAction(url.redirect, parameters)
}

export function doAuthorize(parameters) {
  return getAction(url.authorize, parameters);
}

export function sendMessage(data) {
return postAction(url.sendMessage,data)
}
